Skip to content

fix(web-ui): prevent tab text selection and add device-group close-all menu - #3932

Merged
bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/scene-bar-tab-selection-and-device-close
Nov 16, 2026
Merged

bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/scene-bar-tab-selection-and-device-close

Conversation

@bobleer

@bobleer bobleer commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  1. Prevent tab label text selection & right-click word highlighting:
    • Add -webkit-user-select: none and user-select: none to .tabGroup and .tab in @openbitfun/ui (TabGroup.module.css), as well as SceneBar.scss, SceneTopBar.scss, and content-canvas Tab.scss.
    • Clear any accidental selection range rooted inside the tab bar during onContextMenuCapture in TabGroup and SceneBar (handling macOS WKWebView secondary-click automatic word selection without blocking selectstart, preserving native draggable="true" tab drag-and-drop and any user text selection outside the tab bar).
  2. Add right-click "Close all tabs for this device" context menu on device group labels:
    • Enable pointer events with cursor: default on .openbitfun-scene-bar__device-group while keeping <span role="presentation"> outside SceneTopBar's interactive selector so native window dragging and double-click maximize remain unaffected.
    • Open a context menu (sceneBar.closeDeviceTabs in en-US, zh-CN, and zh-TW) when right-clicking a device group label in SceneBar to close all closable tabs belonging to that device surfaceId (closing inactive tabs before the active tab to avoid intermediate fallback session hydrations, stopping on unsaved/draft close guards, and fencing/dismissing on Peer surface switches).

Type and Areas

Type: Bug fix / UI/UX

Areas: Design System (design-system/packages/ui), Web UI (src/web-ui)

Motivation / Impact

  • Right-clicking a session or scene tab on macOS Desktop (WKWebView) no longer leaves words inside the tab title highlighted in blue behind the context menu, and tab titles cannot be selected as prose.
  • When tabs span multiple devices and are grouped by device name in SceneBar, users can right-click a device name to close all closable tabs under that device in one action.

Verification

  • pnpm --dir design-system run build:ui && node --test design-system/packages/ui/tests/tab-group.test.mjs (13/13 passed)
  • pnpm --dir src/web-ui run test:run src/app/components/SceneBar/SceneBar.test.tsx src/app/components/SceneBar/useSceneTabNavigation.test.tsx src/app/components/SceneBar/SceneBar.performance.test.tsx src/app/components/SceneTopBar/SceneTopBar.test.tsx src/app/stores/sceneStore.test.ts src/app/services/sessionSceneLifecycle.test.ts src/app/components/panels/content-canvas/tab-bar/TabBar.test.tsx (7 test files, 117/117 passed)
  • pnpm run i18n:audit (passed, 0 warnings)
  • pnpm run check:web (typography, appearance contract, theme color, theme visual governance, and tsc --noEmit all passed)
  • pnpm run check:repo-hygiene && git diff --check (passed)
  • node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD (passed)
  • Remote Scenario Coverage: Exercised in local Node / jsdom unit fixtures with simulated multi-device surfaceId grouping (local + peer device) and activateSurface Peer surface-switch fencing/dismissal; not exercised on live SSH Remote Workspace, Remote Control relay, live Peer Device hosts, Detached Dispatch, or native macOS WKWebView runtime.

Reviewer Notes

  • AI-assisted implementation; covered by focused package and Web UI unit/DOM tests plus repository appearance/i18n/hygiene gates (live native macOS WKWebView secondary-click verification recommended).
  • No persisted state, Tauri command, or cross-version wire-protocol changes.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 7fec880 into openBitFun:main Nov 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant